package com.example.xpvideo.Controller;

import com.example.xpvideo.entity.PageResult;
import com.example.xpvideo.entity.PurchaseUsers;
import com.example.xpvideo.entity.ResponseResult;
import com.example.xpvideo.entity.req.SupplierMerchantReq;
import com.example.xpvideo.entity.req.TopLiveReq;
import com.example.xpvideo.entity.req.UpdateReq;
import com.example.xpvideo.entity.res.MerchantsDetailRes;
import com.example.xpvideo.entity.res.MerchantsRes;
import com.example.xpvideo.service.SupplierMerchantsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 供应商城商户管理
 *
 * @author : 洪俊新
 * @date : 2021/7/9 15:28
 * @description:
 */
@RestController
@RequestMapping("/back/supplymerchants")
public class PhpSupplyMerchantsController {
    @Autowired
    private SupplierMerchantsService supplierMerchantsService;

    /**
     * 供应商城商户列表
     * *//*
    @GetMapping("/list")
    public ResponseResult<PageResult<List<MerchantsRes>>> list(SupplierMerchantReq supplierMerchantReq)
             throws Exception{
        return supplierMerchantsService.list(supplierMerchantReq);
    }*/

    /**
     * 商户管理详情
     * */
    @GetMapping("/detail")
    public ResponseResult<MerchantsDetailRes> detail(@NotNull String account)
            throws Exception{
        return supplierMerchantsService.detail(account);
    }

    @PostMapping("/updatemstage")
    public ResponseResult<Object> updateMStage(@NotNull
                                               @RequestBody UpdateReq updateReq) throws Exception{
        return supplierMerchantsService.updateMStage(updateReq);
    }

    @PostMapping("/toplive")
    public ResponseResult<Object> topLive(@NotNull @RequestBody
                                          TopLiveReq topLiveReq) throws Exception{
        return supplierMerchantsService.topLive(topLiveReq);
    }

    @PostMapping("/recommendlive")
    public ResponseResult<Object> recommendLive(@NotNull @RequestBody UpdateReq updateReq) throws Exception{
        return supplierMerchantsService.recommendLive(updateReq);
    }

    @PostMapping("/isoffcial")
    public ResponseResult<Object> isOffcial(@NotNull @RequestBody UpdateReq updateReq) throws Exception{
        return supplierMerchantsService.isOffcial(updateReq);
    }
}
